﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Daltonism="clr-namespace:Daltonism">
	<Style x:Key="sliderStyle" TargetType="Daltonism:PhoneSlider">
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="Maximum" Value="10"/>
		<Setter Property="Minimum" Value="0"/>
		<Setter Property="Value" Value="0"/>
		<Setter Property="Margin" Value="{StaticResource PhoneHorizontalMargin}"/>
		<Setter Property="Background" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
		<Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Daltonism:PhoneSlider">
					<Grid Background="Transparent">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<DoubleAnimation Duration="0" Storyboard.TargetName="HorizontalTrack" Storyboard.TargetProperty="Opacity" To="0.1" />
										<DoubleAnimation Duration="0" Storyboard.TargetName="VerticalTrack" Storyboard.TargetProperty="Opacity" To="0.1" />
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalFill" Storyboard.TargetProperty="Fill">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalFill" Storyboard.TargetProperty="Fill">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Grid x:Name="HorizontalTemplate">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="0"/>
								<ColumnDefinition Width="auto"/>
							</Grid.ColumnDefinitions>
							<Rectangle x:Name="HorizontalTrack" IsHitTestVisible="False" Fill="{TemplateBinding Background}" Opacity="0.2" Grid.ColumnSpan="3" Height="12" Margin="0,32,0,40"/>
							<Rectangle x:Name="HorizontalFill" IsHitTestVisible="False" Fill="{TemplateBinding Foreground}" Grid.Column="0" Height="12" Margin="0,32,0,40"/>
							<RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" IsTabStop="False" Template="{StaticResource PhoneSimpleRepeatButton}" Grid.Column="0" />
							<RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" IsTabStop="False" Template="{StaticResource PhoneSimpleRepeatButton}" Grid.Column="2" />
							<Thumb x:Name="HorizontalThumb" Width="1" Margin="-1,0,0,0" Grid.Column="1" Template="{StaticResource PhoneSimpleThumbHorizontal}" RenderTransformOrigin="0.5,0.5" CacheMode="BitmapCache"/>
						</Grid>
						<Grid x:Name="VerticalTemplate">
							<Grid.RowDefinitions>
								<RowDefinition Height="*"/>
								<RowDefinition Height="0"/>
								<RowDefinition Height="Auto"/>
							</Grid.RowDefinitions>
							<Rectangle x:Name="VerticalTrack" IsHitTestVisible="False" Fill="{TemplateBinding Background}" Opacity="0.2" Grid.RowSpan="3" Width="12" Margin="24,0"/>
							<Rectangle x:Name="VerticalFill" IsHitTestVisible="False" Fill="{TemplateBinding Foreground}" Grid.Row="2" Width="12" Margin="24,0"/>
							<RepeatButton x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" IsTabStop="False" Template="{StaticResource PhoneSimpleRepeatButton}" Grid.Row="0"/>
							<RepeatButton x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" IsTabStop="False" Template="{StaticResource PhoneSimpleRepeatButton}" Grid.Row="2"/>
							<Thumb x:Name="VerticalThumb" Height="1" Margin="0,-1,0,0" Grid.Row="1" Template="{StaticResource PhoneSimpleThumbVertical}" RenderTransformOrigin="0.5,0.5" CacheMode="BitmapCache"/>
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<ControlTemplate x:Key="PhoneSimpleRepeatButton" TargetType="RepeatButton">
		<Rectangle/>
	</ControlTemplate>

	<ControlTemplate x:Key="PhoneSimpleThumbHorizontal" TargetType="Thumb">
		<Border Background="Transparent" Margin="-480,-18">
			<Rectangle Width="2" Height="6" Fill="{StaticResource PhoneForegroundBrush}"/>
		</Border>
	</ControlTemplate>

	<ControlTemplate x:Key="PhoneSimpleThumbVertical" TargetType="Thumb">
		<Border Background="Transparent" Margin="-6,-800">
			<Rectangle Width="6" Height="2" Margin="24,0,0,0" Fill="{StaticResource PhoneForegroundBrush}"/>
		</Border>
	</ControlTemplate>


	<!-- Theme -->
	<LinearGradientBrush x:Key="ThemeBackgroundBrush" StartPoint="0.5,1" EndPoint="0.5,0">
		<GradientStop Color="#FFF9F9E4" Offset="0" />
		<GradientStop Color="#FFE0E3BC" Offset="1" />
	</LinearGradientBrush>
	<SolidColorBrush x:Key="ThemeForegroundBrush" Color="Black" />

	<!--ValidationTooltipTemplate-->
	<ControlTemplate x:Key="ValidationToolTipTemplate">
		<Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
			<VisualStateManager.VisualStateGroups>
				<VisualStateGroup x:Name="OpenStates">
					<VisualStateGroup.Transitions>
						<VisualTransition GeneratedDuration="0"/>
						<VisualTransition GeneratedDuration="0:0:0.2" To="Open">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
									<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
									<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualTransition>
					</VisualStateGroup.Transitions>
					<VisualState x:Name="Closed">
						<Storyboard>
							<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
								<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
							</DoubleAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="Open">
						<Storyboard>
							<DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
								<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
							</DoubleAnimationUsingKeyFrames>
							<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
								<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
							</DoubleAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
			</VisualStateManager.VisualStateGroups>
			<Grid.RenderTransform>
				<TranslateTransform x:Name="xform" X="-25"/>
			</Grid.RenderTransform>
			<Border Margin="4,4,-4,-4" Background="#152A2E31" CornerRadius="4"/>
			<Border Margin="3,3,-3,-3" Background="#252A2E31" CornerRadius="4"/>
			<Border Margin="2,2,-2,-2" Background="#352A2E31" CornerRadius="4"/>
			<Border Margin="1,1,-1,-1" Background="#452A2E31" CornerRadius="4"/>
			<Border Background="#FFDC000C" CornerRadius="4"/>
			<Border CornerRadius="4">
				<Border.Background>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="#66FFFFFF"/>
						<GradientStop Color="#66000000" Offset="1"/>
						<GradientStop Color="#00E5E5E5" Offset="0.1"/>
						<GradientStop Color="#00161616" Offset="0.9"/>
					</LinearGradientBrush>
				</Border.Background>
				<TextBlock Margin="8,3,8,4" MaxWidth="250" UseLayoutRounding="false" Foreground="White" Text="{Binding Path=(Validation.Errors)[0].ErrorContent}" TextWrapping="Wrap"/>
			</Border>
		</Grid>
	</ControlTemplate>

	<!--Main Bubble Colors-->
	<Color x:Key="LightColor">#f9f9e4</Color>
	<Color x:Key="DarkColor">#e0e3bc</Color>
	<Color x:Key="TextColor">#66603a</Color>
	<SolidColorBrush x:Key="LightBrush" Color="{StaticResource LightColor}" />
	<SolidColorBrush x:Key="DarkBrush" Color="{StaticResource DarkColor}" />
	<SolidColorBrush x:Key="TextBrush" Color="{StaticResource TextColor}" />
	<SolidColorBrush x:Key="DisabledColor" Color="#8CFFFFFF" />
	<!--Gradient Brushes-->
	<RadialGradientBrush x:Key="HaloMask">
		<RadialGradientBrush.RelativeTransform>
			<TransformGroup>
				<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.25" ScaleY="4" />
				<TranslateTransform Y="-.2" />
			</TransformGroup>
		</RadialGradientBrush.RelativeTransform>
		<GradientStop Color="#00ffffff" Offset="0.528" />
		<GradientStop Color="#26FFFFFF" Offset="0.776" />
		<GradientStop Color="#BFFFFFFF" Offset="1" />
	</RadialGradientBrush>

	<LinearGradientBrush x:Key="FocusMask" EndPoint="0,.5" StartPoint="1,.5">
		<GradientStop Color="#99000000" Offset="0" />
		<GradientStop Color="#33FFFFFF" Offset=".5" />
		<GradientStop Color="#99000000" Offset="1" />
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="BottomShadowMask" EndPoint="0.5,1.75" StartPoint="0.5,-.25">
		<GradientStop Color="#00000000" Offset="0.2" />
		<GradientStop Color="#FFFFFFFF" Offset="1" />
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="BoxBottomShadowMask" EndPoint="0.5,1" StartPoint="0.5,-1">
		<GradientStop Color="#FFFFFFFF" Offset="0" />
		<GradientStop Color="#00000000" Offset=".75" />
	</LinearGradientBrush>

	<!-- Button -->
	<Style TargetType="Button" x:Key="BubbleCreme">
		<Setter Property="Foreground" Value="{StaticResource TextBrush}" />
		<Setter Property="Background" Value="{StaticResource LightBrush}" />
		<Setter Property="BorderBrush" Value="{StaticResource DarkBrush}" />
		<Setter Property="BorderThickness" Value=".5,.5,1.5,1.5" />
		<Setter Property="Padding" Value="8,3" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Grid>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="FocusStates">
								<VisualState x:Name="Unfocused" />
								<VisualState x:Name="Focused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="HasFocus" Storyboard.TargetProperty="(UIElement.Visibility)">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="CommonStates">
								<VisualStateGroup.Transitions>
									<VisualTransition GeneratedDuration="00:00:00.2" />
									<VisualTransition From="Pressed" GeneratedDuration="00:00:00" />
									<VisualTransition From="MouseOver" GeneratedDuration="00:00:00" To="Pressed" />
								</VisualStateGroup.Transitions>
								<VisualState x:Name="MouseOver">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Normal" />
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.BorderThickness)">
											<DiscreteObjectKeyFrame KeyTime="0" Value="2.5,2.5,.5,.5" />
										</ObjectAnimationUsingKeyFrames>
										<DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)">
											<SplineDoubleKeyFrame KeyTime="0" Value="1" />
										</DoubleAnimationUsingKeyFrames>
										<DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)">
											<SplineDoubleKeyFrame KeyTime="0" Value="1" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="0" Value="0.35" />
										</DoubleAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.BorderThickness)">
											<DiscreteObjectKeyFrame KeyTime="0" Value=".5,.5,.5,.5" />
										</ObjectAnimationUsingKeyFrames>
										<DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
											<SplineDoubleKeyFrame KeyTime="0" Value="0.65" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="Background" CornerRadius="12" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" />
						<Grid x:Name="InnerShadow" Grid.RowSpan="2" Grid.ColumnSpan="2">
							<Border x:Name="BottomShadow" Background="{TemplateBinding BorderBrush}" CornerRadius="12" OpacityMask="{StaticResource BottomShadowMask}" />
							<Border x:Name="Halo" CornerRadius="12" Background="{TemplateBinding BorderBrush}" OpacityMask="{StaticResource HaloMask}" />
						</Grid>
						<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" RenderTransformOrigin="0.5,0.5">
							<ContentPresenter.RenderTransform>
								<TransformGroup>
									<TranslateTransform />
								</TransformGroup>
							</ContentPresenter.RenderTransform>
						</ContentPresenter>
						<Border x:Name="HasFocus" CornerRadius="13" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Margin="-3" Visibility="Collapsed" OpacityMask="{StaticResource FocusMask}" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>